<%--
  Created by IntelliJ IDEA.
  User: 王韫琛
  Date: 2021/1/6
  Time: 22:30
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
    <title>查询入住用户</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/webjars/layui/2.5.6/css/layui.css">
    <link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/webjars/layui/2.5.6/layui.all.js">
</head>
<body>
<div class="container">
    <div class="row clearfix">
        <div class="col-md-12 column">
            <div class="page-header">
                <h1>
                    <small>查询是否登记</small>
                </h1>
            </div>
        </div>
    </div>
    <div class="col-md-8 column">
        <form class="form-inline" action="/admin_Query_Id_Card" method="post">
            <label>请输入用户身份证:</label>
            <div class="layui-input-inline">
                <input type="text" name="identity_card" id="identity_card" class="layui-input" required lay-verify="email"
                       lay-reqText="身份证号" placeholder="身份证号" autocomplete="off">
            </div>
            <input type="submit" value="查询" class="btn btn-primary" onclick="onclickFun()">
            <span style="color: red;font-weight: bold" id="identity_card_span"></span>
            <span style="color: red;font-weight: bold">${error}</span>
        </form>
    </div>
    <div class="row clearfix">
        <div class="col-md-12 column">
            <table class="table table-hover table-striped">
                <thead>
                <tr>
                    <th style='vertical-align: middle;text-align: center;'>ID</th>
                    <th style='vertical-align: middle;text-align: center;'>用户名</th>
                    <th style='vertical-align: middle;text-align: center;'>姓名</th>
                    <th style='vertical-align: middle;text-align: center;'>性别</th>
                    <th style='vertical-align: middle;text-align: center;'>身份</th>
                    <th style='vertical-align: middle;text-align: center;'>身份证</th>
                    <th style='vertical-align: middle;text-align: center;'>添加时间</th>
                </tr>
                </thead>
                <tbody>
                <c:forEach var="allUser" items="${list}">
                    <tr>
                        <td style='vertical-align: middle;text-align: center;'>${allUser.id}</td>
                        <td style='vertical-align: middle;text-align: center;'>${allUser.username}</td>
                        <td style='vertical-align: middle;text-align: center;'>${allUser.name}</td>
                        <td style='vertical-align: middle;text-align: center;'>${allUser.gender}</td>
                        <td style='vertical-align: middle;text-align: center;'>${allUser.permission}</td>
                        <td style='vertical-align: middle;text-align: center;'>${allUser.identity_card}</td>
                        <td style='vertical-align: middle;text-align: center;'>${allUser.addtime}</td>
                        <td><a href="${pageContext.request.contextPath}/user_add_information"><span style="color: red;font-weight: bold">${error2}</span></a></td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
        </div>
    </div>
</div>
<script type="text/javascript">
    function onclickFun() {
        var identity_card = document.getElementById("identity_card");
        var reg=/^[1-9]{1}[0-9]{14}$|^[1-9]{1}[0-9]{16}([0-9]|[xX])$/;
        let identity_card_span = document.getElementById('identity_card_span');
        if (reg.test(identity_card)){
            identity_card_span.innerHTML="身份证合法";
        }else {
            identity_card_span.innerHTML="身份证不合法";
        }
    }
</script>
</body>
</html>
